package cn.han.oop;
//本类用于描述学生这一类事物
public class Student {
    //1.1定义学生属性
    //1.2封装学生的属性
    private int id ;
    private String name;
    private char gender;
    private String address;
    private String subject;
    //1.3提供属性对应的get与set方法
    //3.1提供本类的普通方法
    public void study(){
        System.out.println("学习使我困");
    }
    //3.2提供本类的普通方法2
    public void eat(int n){
        System.out.println("今天我要干它"+n+"碗大米饭");
    }
    //3.3提供本类的普通方法3
    public String sleep(){
        return "今天又失眠了";
    }
    //4.提供本类的一个展示类型与所有属性的和属性值方法
    public void show(){
        System.out.println("Student:[id="+id
                +",name="+name+",gender="+gender
                +",address="+address+
                ",subject="+subject+"]");
    }
    //2.1提供本类的无参构造

    public Student(){
        System.out.println("我是无参构造");
    }
    //2.2提供本类的全参构造


    public Student(int id, String name, char gender, String address, String subject) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.address = address;
        this.subject = subject;
        System.out.println("我是全参构造");
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }
}
